package com.medical.system.model.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.medical.excel.annotation.ExcelDictFormat;
import com.medical.excel.convert.ExcelDictConvert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@Data
@ExcelIgnoreUnannotated
public class OperLogVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @ExcelProperty(value = "主键ID")
    private Long id;

    @Schema(description = "租户ID")
    private String tenantId;

    @Schema(description = "模块标题")
    @ExcelProperty(value = "操作模块")
    private String title;

    @Schema(description = "业务类型")
    @ExcelProperty(value = "业务类型")
    private Integer businessType;

    @Schema(description = "业务类型数组")
    private Integer [] businessTypes;

    @Schema(description = "请求方法")
    @ExcelProperty(value = "请求方法")
    private String method;

    @Schema(description = "请求方式")
    @ExcelProperty(value = "请求方式")
    private String requestMethod;

    @Schema(description = "操作类别：0-其他、1-后台用户、2-手机端用户")
    @ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户")
    private Integer operatorType;

    @Schema(description = "操作人员")
    @ExcelProperty(value = "操作人员")
    private String operName;

    @Schema(description = "部门名称")
    @ExcelProperty(value = "部门名称")
    private String deptName;

    @Schema(description = "请求URL")
    @ExcelProperty(value = "请求地址")
    private String operUrl;

    @Schema(description = "主机地址")
    @ExcelProperty(value = "操作地址")
    private String operIp;

    @Schema(description = "操作地点")
    @ExcelProperty(value = "操作地点")
    private String operLocation;

    @Schema(description = "请求参数")
    @ExcelProperty(value = "请求参数")
    private String operParam;

    @Schema(description = "请求参数")
    @ExcelProperty(value = "返回参数")
    private String jsonResult;

    @Schema(description = "操作状态（0正常 1异常）")
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_common_status")
    private Integer status;

    @Schema(description = "错误消息")
    @ExcelProperty(value = "错误消息")
    private String errorMsg;

    @Schema(description = "操作时间")
    @ExcelProperty(value = "操作时间")
    private Date operTime;

    @Schema(description = "消耗时间")
    @ExcelProperty(value = "消耗时间")
    private Long costTime;
}
